/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package validator.tubes.ai.i;

/**
 *
 * @author Mahdan Ahmad F A
 */
public class Barang {
    private String kode;
    private int harga;
    private int restock;
    private int jumlah;
    
    public Barang(){
        kode    = "-";
        harga   = 0;
        restock = 0;
        jumlah  = 0;
    }
    
    public Barang(String _kode, int _harga, int _restock) {
        kode    = _kode;
        harga   = _harga;
        restock = _restock;
        jumlah  = 0;
    }
    
    public String getkode() {
        return kode;
    }
    
    public int getharga() {
        return harga;
    }
    
    public int getrestock() {
        return restock;
    }
    
    public int getjumlah() {
        return jumlah;
    }
    
    public void setkode(String some) {
        kode    = some;
    }
    
    public void setharga(int some) {
        harga   = some;
    }
    
    public void setrestock(int some) {
        restock = some;
    }
    
    public void resetjumlah() {
        jumlah = 0;
    }
    public void addjumlah(int some) {
        jumlah += some;
    }

    public void print() {
        System.out.println("Kode    = " + kode);
        System.out.println("Harga   = " + harga);
        System.out.println("Restock = " + restock);
        System.out.println("Jumlah  = " + jumlah);
        System.out.println();
    }
}
